﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Promotion_Promotion4Edit" Codebehind="Promotion4Edit.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <script src="../Include/Js/clock.js" type="text/javascript"></script>
    <script src="../Include/Js/check.js" type="text/javascript"></script>
    <script src="../Include/Js/grd.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div align="justify">
    <h2 id="idTitle" runat="server">新增优惠活动</h2>
    <div class="menu_bg3"><table id="mainTab" cellpadding="1" cellspacing="1" border="0" width="700">
    <tr>
        <td align="left" style="height: 26px;width:60px;">活动编号：</td>
        <td align="left" style="height: 26px"><asp:Label ID="lbl_Promotion" runat="server"/></td>
        <td align="left" style="height: 26px;width:60px;">活动名称：</td>
        <td align="left" style="height: 26px"><asp:TextBox ID="txt_ActiveName" runat="server"/></td>
        
    </tr>
    <tr>
         <td align="left">活动时间：</td>
         <td align="left"><input id="Text1"  onmousedown="setday(this)"  type="text" runat="server" />至<input id="Text2"  onmousedown="setday(this)"
                        type="text" runat="server" />
        </td>  
        <td align="left">折扣：</td>
        <td align="left"><asp:TextBox ID="txt_ZK" runat="server"/></td> 
    </tr>
    <tr>
    <td align="left" style="height: 24px">优惠范围：</td>
    <td align="left" style="height: 24px">
    <asp:DropDownList ID="ddl_Range" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Range_SelectedIndexChanged">
    <asp:ListItem Value="1">所有商品</asp:ListItem>
    <asp:ListItem Value="2">分类</asp:ListItem>
    <asp:ListItem Value="3">指定商品</asp:ListItem>
    <asp:ListItem Value="4">品牌</asp:ListItem>
    </asp:DropDownList>
        <asp:DropDownList ID="ddl_Type" runat="server" DataTextField="CT_NAME" DataValueField="CT_CODE">
        <asp:ListItem Text="类别"></asp:ListItem>
    </asp:DropDownList>
        <asp:DropDownList ID="ddl_PinPai" runat="server" DataTextField="PPMC" DataValueField="PPDM">
        </asp:DropDownList></td>
    <td align="left" style="height: 26px">减免金额：</td>
    <td align="left" style="height: 26px"><asp:TextBox id="txt_JE" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td align="left" style="height: 24px">优惠方式：</td>
    <td align="left" style="height: 24px">
    <asp:DropDownList ID="ddl_Way" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddl_Way_SelectedIndexChanged">
    <asp:ListItem Value="1">打折</asp:ListItem>
    <asp:ListItem Value="2">减免金额</asp:ListItem>
    <asp:ListItem Value="3">赠送礼品</asp:ListItem>
    </asp:DropDownList>
    </td>
    <td align="left" style="height: 26px">赠送数量：</td>
    <td align="left" style="height: 26px"><asp:TextBox id="txt_SL" runat="server"></asp:TextBox></td>
    </tr>
    <tr>
    <td align="left" style="height: 40px">描述：</td>
    <td style="height: 40px"><textarea id="Tbx_Remark" rows="2"  cols="30" style="width: 306px;" runat="server"></textarea></td>
    <td align="left" style="height: 26px">启用会员折扣：</td>
    <td><asp:CheckBox ID="chkZK" runat="server" /></td>
    </tr>
    </table>
    <div id="idSel" runat="server">选择商品
    <div><asp:Label ID="lbl_SPDM" Text="代码：" runat="server"></asp:Label>
        <asp:TextBox ID="txt_SPDM" runat="server"></asp:TextBox>
        <asp:Label ID="lbl_SPMC" runat="server" Text="名称："></asp:Label>
        <asp:TextBox ID="txt_SPMC" runat="server"></asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="查询" /></div>
    <table id="selTable" border="0" width="100%">
        <tr>
        <td align="left" style="height: 257px" >
            <asp:GridView ID="grdProduct" runat="server"  Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="8" DataKeyNames="SPDM" OnPageIndexChanging="grdProduct_PageIndexChanging">
                <Columns>
                    <asp:TemplateField HeaderText="选择">
                        <ItemTemplate>
                            <asp:CheckBox ID="chk" runat="server" OnCheckedChanged="chk_CheckedChanged"/>
                        </ItemTemplate>
                        <HeaderTemplate>
                            <input type="checkbox" id="chkAll"  runat="server" onclick="SelectAll(this,'grdProduct')"/>&nbsp;
                        </HeaderTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="SPDM" HeaderText="商品代码" SortExpression="SPDM" />
                    <asp:BoundField DataField="SPMC" HeaderText="商品名称" SortExpression="SPMC" />
                    <asp:BoundField DataField="BZSJ" HeaderText="标准售价" SortExpression="BZSJ" HtmlEncode="false" DataFormatString="{0:N2}" />
                </Columns>
                <PagerSettings LastPageText="&amp;lt;&amp;lt;" NextPageText="&amp;lt;&amp;lt;" />
            </asp:GridView>
            <asp:Button ID="btn_SubPro" runat="server" OnClick="btn_SubPro_Click" Text="提交" /></td>
        </tr>
    </table>
    </div>
    <div id="idselGift" runat="server">选择礼品
    <table id="selGift" border="0" width="100%">
        <tr>
            <td>
            <asp:GridView ID="grdGift" runat="server"  Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="8" DataKeyNames="SPDM" OnPageIndexChanging="grdGift_PageIndexChanging">
                <Columns>
                    <asp:TemplateField HeaderText="选择">
                        <ItemTemplate>
                            <asp:CheckBox ID="chkGift" runat="server" OnCheckedChanged="chkGift_CheckedChanged"/>
                        </ItemTemplate>
                        <HeaderTemplate>
                            <input type="checkbox" id="chkAllGift"  runat="server" onclick="SelectAll(this,'grdGift')"/>
                        </HeaderTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="SPDM" HeaderText="商品代码" SortExpression="SPDM" />
                    <asp:BoundField DataField="SPMC" HeaderText="商品名称" SortExpression="SPMC" />
                </Columns>
                <PagerSettings LastPageText="&amp;lt;&amp;lt;" NextPageText="&amp;lt;&amp;lt;" />
            </asp:GridView>
                <asp:Button ID="btn_SubGift" runat="server" OnClick="btn_SubGift_Click" Text="提交" /></td>
        </tr>
        
    </table>
    </div>
    <div id="idShow" runat="server">指定范围的商品

    <table id="showTable" border="0" width="100%">
        <tr>
        <td align="left" style="height: 239px" >
            <asp:GridView ID="grdShowProduct" runat="server"  Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="8" OnPageIndexChanging="grdShowProduct_PageIndexChanging" OnRowCommand="grdShowProduct_RowCommand" OnRowCreated="grdShowProduct_RowCreated">
                <Columns>
                    <asp:BoundField DataField="SPDM" HeaderText="商品代码" SortExpression="SPDM" />
                    <asp:BoundField DataField="SPMC" HeaderText="商品名称" SortExpression="SPMC" />
                    <asp:BoundField DataField="BZSJ" HeaderText="标准售价" SortExpression="BZSJ" HtmlEncode="False" DataFormatString="{0:N2}"/>
                     <asp:TemplateField HeaderText="操作">
                           <ItemTemplate>
                                  <asp:LinkButton ID="lbl_DelPro" runat="server" CausesValidation="False" CommandName="DelPro"
                                        CommandArgument='<%#Eval("SPDM") %>' Text="删除" OnClientClick='return confirm("确定删除吗？")'></asp:LinkButton>
                            </ItemTemplate>
                         <HeaderStyle BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Left" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </td>
        </tr>
    </table>
    </div> 
    <div id="idShowGift" runat="server">指定的礼品

    <table id="showGift" border="0" width="100%">
        <tr>
            <td>
            <asp:GridView ID="grdShowGift" runat="server"  Width="100%" AutoGenerateColumns="False" AllowPaging="True" PageSize="8" OnPageIndexChanging="grdShowGift_PageIndexChanging" OnRowCommand="grdShowGift_RowCommand" OnRowCreated="grdShowGift_RowCreated">
                <Columns>
                    <asp:BoundField DataField="SPDM" HeaderText="商品代码" SortExpression="SPDM" />
                    <asp:BoundField DataField="SPMC" HeaderText="商品名称" SortExpression="SPMC" />
                     <asp:TemplateField HeaderText="操作">
                           <ItemTemplate>
                                  <asp:LinkButton ID="lbl_DelGift" runat="server" CausesValidation="False" CommandName="DelGift"
                                        CommandArgument='<%#Eval("SPDM") %>' Text="删除" OnClientClick='return confirm("确定删除吗？")'></asp:LinkButton>
                            </ItemTemplate>
                         <HeaderStyle BorderStyle="Solid" ForeColor="Black" HorizontalAlign="Left" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            </td>
        </tr>
    </table>
    </div>  </div>
    <div class="menu_bg">
    <asp:Button ID="btnAddOrUpdate" CssClass="input_button" runat="server" Text="添加" OnClick="btnAddOrUpdate_Click"/>
        <asp:Button ID="btnCancel" runat="server" CssClass="input_button"
            Text="取消" PostBackUrl="~/Promotion/Promotion4List.aspx" />
        <asp:HiddenField ID="hd_SPDMS" runat="server" />
        <asp:HiddenField ID="hd_GIFTS" runat="server" />
    </div>
    </div>
    </form>
</body>
</html>
